<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Promisez终止promise链条</title>
    <script src="promise.js"></script>
</head>
<body>

<script>
    /**
     中断promise链?
        (1)	当使用promise的then链式调用时, 在中间中断, 不再调用后面的回调函数
        (2)	办法: 在回调函数中返回一个pendding状态的promise对象
     */
    new Promise((resolve, reject) => {
        resolve('OK');
    }).then(value=>{
        console.log(111);
        //唯一的方式
        return new Promise(() => {});
    }).then(value => {
        console.log(222);
    }).then(value => {
        console.log(333);
    });
</script>
</body>
</html>